#ifndef _SERVO_H
#define _SERVO_H
#include "stm32f4xx_hal.h"
#include "main.h"
#include "bsp_can.h"
#include "pid.h"
#include "Remote_Control.h"
#include "usart.h"


typedef enum
{
	no1=0x00,
	no2=0x01,
	no3=0x02,
	no4=0x03,
}Servo_id;

typedef struct All_Servo_Typedef
{
	uint8_t head1;
	uint8_t head2;
	uint8_t control_num;
	uint8_t byte_num;
	Servo_id servo_id;
//	uint16_t angle;
	uint8_t angle_low;
	uint8_t angle_high;
	uint8_t time_interval_low;
	uint8_t time_interval_high;
	uint8_t power_low;
	uint8_t power_high;
	uint8_t checksum;
}All_Servo_Typedef;

extern All_Servo_Typedef servo;
extern char Buffer_servo[];
extern int buffer_size;

void Set_servo_angle( Servo_id ser_id,int ser_angle);

void send_data_usart7(All_Servo_Typedef *ser,uint8_t len);


#endif

